public class Test {
    public static void main(String[] args) {
        System.out.println(facSum(2));

    }

    public static int facSum(int n){
        int sum = 0 ;
        for (int i = 1; i <= n ; i++) {
            sum += fac(i) ;
        }
        return sum ;
    }
    public static int fac(int n){
        int ret = 1 ;
        for (int i = 1; i <= n ; i++) {
            ret = i * ret ;
        }
      return ret ;
    }
}
